using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Spinning.Spinning.Unitity
{
  public  class Constants
    {
        public static readonly int Window_Width = 480;
        public static readonly int Window_Height = 800;

        public static readonly float MeterToPixal = 32;
        public static readonly ushort CategoryBitsPlayer = 2;
        public static readonly ushort CategoryBitsEnemy = 4;
        public static readonly ushort CategoryBitsMarble = 8;
        public static readonly ushort CategoryBitsWall = 16;
        public static readonly ushort CategoryBitsBoss = 32;
        public static readonly ushort CategoryBitsItem = 64;

        public static readonly ushort MaskBitsPlayer = (ushort)(CategoryBitsEnemy | CategoryBitsWall | CategoryBitsBoss | CategoryBitsItem | CategoryBitsPlayer);
        public static readonly ushort MaskBitsEnemy = (ushort)(CategoryBitsPlayer | CategoryBitsEnemy | CategoryBitsMarble);
        public static readonly ushort MaskBitsMarble = CategoryBitsEnemy;
        public static readonly ushort MaskBitsWall = (ushort)(CategoryBitsPlayer | CategoryBitsBoss);
        public static readonly ushort MaskBitsBoss = (ushort)(CategoryBitsPlayer | CategoryBitsWall);
        public static readonly ushort MaskBitsItem = CategoryBitsPlayer;

        public static readonly float background = 0;
        public static readonly float player = 2f;
        public static readonly float item = 1.6f;
        public static readonly float marble = 1.5f;
        public static readonly float enemy = 1;
        public static readonly float fail = 4;
        public static readonly float uibackground = 3;
        public static readonly float ui = 5;
        public static readonly float debugText = 500;

        public static readonly float playerDensity = 100000;
        public static readonly float enemyDensity = 0.01f;

        public static readonly Point playerAnimationFrame = new Point(3, 14);

        //public static readonly int CharOmegaId = 2;
        //public static readonly int CharPhiId = 1;
        //public static readonly int CharThetaId = 0;

        //public static readonly int SpinThetaId = 5;
        //public static readonly int SpinTiawanId = 4;
        //public static readonly int SpinRussiaId = 3;
        //public static readonly int SpinPhiId = 2;
        //public static readonly int SpinOmegaId = 1;
        //public static readonly int SpinIndiaId = 0;

        public enum PlayerId
        {
            Omega, Phi, Theta
        }

        public enum SpinningType
        {
            Omega, Phi, Theta, India, Russia, Tiawan
        }

        public enum Property
        {
            Water, Wind, Fire
        }

        public enum ItemTypes
        {
            Copter, Marble, Doll, Sandbag, Windmill, Empty
        }

        public static int MappingSpinning(Constants.SpinningType spin)
        {
            int i = 0;
            switch (spin)
            {
                case Unitity.Constants.SpinningType.India:
                    i = 0;
                    break;
                case Unitity.Constants.SpinningType.Omega:
                    i = 1;
                    break;
                case Unitity.Constants.SpinningType.Phi:
                    i = 2;
                    break;
                case Unitity.Constants.SpinningType.Russia:
                    i = 3;
                    break;
                case Unitity.Constants.SpinningType.Theta:
                    i = 5;
                    break;
                case Unitity.Constants.SpinningType.Tiawan:
                    i = 4;
                    break;
            }
            return i;
        }

        public static int MappingPlayer(Constants.PlayerId _player)
        {
            int i = 0;
            switch (_player)
            {
                case Constants.PlayerId.Omega:
                    i = 2;
                    break;
                case Constants.PlayerId.Phi:
                    i = 1;
                    break;
                case Constants.PlayerId.Theta:
                    i = 0;
                    break;
            }
            return i;
        }


    }
}
